package com.greensam.pixelengine.pojo.emuns;

import lombok.Getter;

/**
 * @author Ma Chengrui
 * @since 2025/8/1 9:59
 */
@Getter
public enum SpaceLevelEnum {

    COMMON(0, "普通版", 100L * 1024 * 1024),
    PROFESSIONAL(1, "专业版", 1000L * 1024 * 1024),
    FLAGSHIP(2, "旗舰版", 10000L * 1024 * 1024),
    ;

    private final int value;

    private final String desc;

    private final long maxSize;

    /**
     * @param value    值
     * @param desc     文本
     * @param maxSize  最大图片容量
     */
    SpaceLevelEnum(int value, String desc, long maxSize) {
        this.value = value;
        this.desc = desc;
        this.maxSize = maxSize;
    }

    /**
     * 根据value获取枚举
     */
    public static SpaceLevelEnum getByValue(int value) {
        for (SpaceLevelEnum spaceLevelEnum : values()) {
            if (spaceLevelEnum.value == value) {
                return spaceLevelEnum;
            }
        }
        return null;
    }
}
